﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraBars.Ribbon;
namespace NotebookS2
{
    public partial class CRYSTAL_DR_LOG_PARAM : RibbonForm
    {
        public CRYSTAL_DR_LOG_PARAM()
        {
            InitializeComponent();
        }

        public Form MdiParentForm { get; set; }
        public string ConnectionString { get; set; }

        //oCommand.Parameters.Add(new SqlParameter("@WITHDRAFT", Convert.ToInt16(this.WithDraft)));
        //oCommand.Parameters.Add(new SqlParameter("@WITHPOSTED", Convert.ToInt16(this.WithPosted)));
        //oCommand.Parameters.Add(new SqlParameter("@WITHOPEN", Convert.ToInt16(this.WithOpen)));
        //oCommand.Parameters.Add(new SqlParameter("@WITHCLOSED", Convert.ToInt16(this.WithClosed)));

        private void CRYSTAL_DR_LOG_PARAM_Load(object sender, EventArgs e)
        {
            
            dtFromDate.EditValue = System.DateTime.Now;
            dtToDate.EditValue = System.DateTime.Now;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {

            CRYSTAL_DR_LOG oForm = new CRYSTAL_DR_LOG();
            this.Hide();
            
            oForm.ConnectionString = this.ConnectionString;
            oForm.FromDate = (DateTime)dtFromDate.EditValue;
            oForm.ToDate = (DateTime)dtToDate.EditValue;

            oForm.WithDelivered = chkDelivered.Checked;
            oForm.WithDraft = chkDraft.Checked;
            oForm.WithOpen = chkOpen.Checked;
            oForm.WithPosted = chkPosted.Checked;
            oForm.WithClosed = chkClosed.Checked;
            oForm.WindowState = FormWindowState.Maximized;
            oForm.ShowDialog();

            this.Close();

        }
    }
}
